<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="../common.inc" %>    
<!-- 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link href="./css/style.css" rel="stylesheet" type="text/css" />
<link href="./css/dtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="./js/dtree.js"></script>
<script type="text/javascript" language="javascript">
<!--
	function showHidden(id){
		var obj = document.getElementById(id);
		if(obj.style.display == "none"){
			document.getElementById(id).style.display = "block";
		}else{
			document.getElementById(id).style.display = "none";
		}
	}
	
-->
</script>
</head>
<body>
	<table cellpadding="0" cellspacing="0" class="table_frame" height="99%" style="width:expression(document.body.clientWidth); ">
		<tr>
			<td valign="top" class="dept_td_line">
				<div class="dept_tree_title">销售阶段</div>
				<div class="dept_tree">
					<script type="text/javascript">
					<!--
						d1 = new dTree('d1');
						d1.add('0','-1',"销售阶段",'','','','','','true');
					//-->
					</script>
					<c:forEach var="saleStage" items="${saleStages}">
					<script type="text/javascript">
					<!--
						d1.add('${saleStage.stageCode}','0','${saleStage.stageName}','','','','','','true');
					//-->
					</script>
						<c:forEach var="saleRecord" items="${saleRecords}">
						<c:if test="${saleRecord.saleStageId == saleStage.stageCode}">
						<script type="text/javascript">
						<!--
							d1.add('${saleRecord.id}+999999','${saleRecord.saleStageId}',"<fmt:formatDate value='${saleRecord.contactDate}' pattern='yyyy-MM-dd'/>"
								,'./saleRecord.do?action=preUpdateSaleRecordInfo&id=${saleRecord.id}&customerId=${saleRecord.customerId}&sign=${sign}','','uSaleRecord','','','true');
						//-->
						</script>
						</c:if>
						</c:forEach>
					</c:forEach>
					<script type="text/javascript">
					<!--
						document.write(d1);					
					//-->
					</script>
				</div>
			</td>
			<td width="10"></td>
			<td valign="top">
				<iframe src="./saleRecord.do?action=preUpdateSaleRecordInfo&customerId=${customerId}&sign=${sign}" id="uSaleRecord" name="uSaleRecord" frameborder="2" scrolling="no" width="100%" 
					onload="this.height=uSaleRecord.document.body.scrollHeight;"></iframe>
			</td>
		</tr>
	</table>
	<input id="sign" name="sign" type="hidden" value="${sign}"/>
	<input id="customerId" name="customerId" type="hidden" value="${customerId}"/>
</body>
</html>